package com.wyw.function.learning.demo6;

import com.wyw.function.learning.common.Dish;
import com.wyw.function.learning.common.DishClient;
import com.wyw.function.learning.common.ToListCollector;

import java.util.List;

/**
 * @Title
 * @Description
 * @Author Mr Wu yewen.wu.china@gmail.com
 * Update History:
 * Author        Time            Content
 */
public class DemoClient16 {

    /**
     * 收集器接口：Collector接口包含了一系列方法，为实现具体的归约操作（即收集器）提供了范本
     */
    public static void main(String[] args) {
        List<Dish> menu = DishClient.getMenu();
        List<Dish> collect = menu.stream().collect(new ToListCollector<Dish>());
        System.out.println(collect);
    }


}
